home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compendium Deluxe 2
/
LSD and 17bit Compendium Deluxe - Volume II.iso
/
a
/
prog
/
asmsrc
/
phagexsources.lha
/
source
/
IffBitz.s
< prev
next >
Wrap
Text File
|
1993-08-20
|
838b
|
52 lines
ConvertIFF Lea AnimGFXData(pc),a1
Move.l (a1)+,d0
Cmp.l #'FORM',d0
Beq FoundIFF
Rts
FoundIFF Move.l (a1)+,d1
NewForm Move.l (a1)+,d0
Cmp.l #"ANIM",d0
Beq GetAnim
Cmp.l #"ILBM",d0
Beq GetAnim
Rts
GetAnim Move.l (a1)+,d0
Move.l (a1)+,d1
Cmp.l #"FORM",d0
Beq NewForm
Cmp.l #"BODY",d0
Beq DecrunchIFF
EndHunk Add.l d1,a1
Btst #0,d1
Beq SkipTest
Addq.l #1,a1
SkipTest Lea AnimGFXData(pc),a5
Add.l #EndFile-AnimGFXData,a5
Cmp.l a5,a1
Blt GetAnim
ExitConv Rts
DecrunchIFF Move.l ScreenBase1(pc),a3
Move.l d1,d7
Move.l a1,a2
Move.l a2,a4
Add.l d1,a4
DecLoop Moveq #0,d0
Move.b (a2)+,d0
Bmi GetByte
DataLoop Move.b (a2)+,(a3)+
Dbf d0,DataLoop
Bra CheckLast
GetByte Cmp.b #-128,d0
Beq CheckLast
Neg.b d0
Move.b (a2)+,d2
ByteLoop Move.b d2,(a3)+
Dbf d0,ByteLoop
CheckLast Cmpa.l a2,a4
Bgt DecLoop
Bra EndHunk